#include<iostream>
#include<string>
#include<cmath>
using namespace std;

int main()
{
  int i,j,v,e;
  e = 5000;
  int a,b,w;
    
 cout<<"echo ------------------ \n echo E保持不变，V变化 \n echo ------------------"<< endl;  
 // cout<<"echo --邻接表-- \n "<< endl;
 for(v=3000; v<10000; v+=1000)
    {
  cout<<"\n echo ";
	cout<<"1 "<< v<<" "<< e<<" ";
	for(i=0; i<v;i++)
	cout <<"v"<<to_string(i)<< " 1 ";

	for(i=0;i<e;i++)
	  {
	    a = rand()%v;
	    do{
	      b = rand()%v;
	    } 
	    while( a == b );

	    w = rand()%100;
	    cout<<"v"<<to_string( a )<<" "<<"v"<<to_string( b )<<" "<< to_string( w )<<" ";

	  }
	cout<<"v1";

	cout<< "| ./test2 | grep time";
	  }


  
 cout<<"\n echo ------------------ \n echo V保持不变，E变化 \n echo ------------------"<< endl;
 //cout<<"echo --邻接表-- \n "<< endl;
 v = 4000;
 for(e = 4000; e < 20000 ; e+=500)
    {
  cout<<"\n echo ";
	cout<<"1 "<< v<<" "<< e<<" ";
	for(i=0; i<v;i++)
	cout <<"v"<<to_string(i)<< " 1 ";

	for(i=0;i<e;i++)
	  {
	    a = rand()%v;
	    do{
	      b = rand()%v;
	    } 
	    while( a == b );

	    w = rand()%100;
	    cout<<"v"<<to_string( a )<<" "<<"v"<<to_string( b )<<" "<< to_string( w )<<" ";

	  }
	cout<<"v1";

	cout<< "| ./test2 | grep time";
	  }
  
  cout<<"\n echo ------------------ \n echo 保持VE不变，V和E变化 \n echo ------------------"<< endl;
 //VE = 2^26

 for(int suibian = 0;suibian<3 ; suibian++)
    {
      v = pow( 2, 10 + suibian );
      e = pow( 2, 16 - suibian );
  cout<<"echo ";
	cout<<"1 "<< v <<" "<< e <<" ";
	for(i=0; i<v;i++)
	cout <<"v"<<to_string(i)<< " 1 ";

	for(i=0;i<e;i++)
	  {
	    a = rand()%v;
	    do{
	      b = rand()%v;
	    } 
	    while( a == b );

	    w = rand()%100;
	    cout<<"v"<<to_string( a )<<" "<<"v"<<to_string( b )<<" "<< to_string( w )<<" ";

	  }
	cout<<"v1";

	cout<< "| ./test2 | grep time"<<endl;;
	  }
 
 cout<<"\n echo ------------------ \n echo VE总体变化 \n echo ------------------"<< endl;
 
 for(int suibian =0; suibian < 6 ; suibian++)
    {
      v = pow( 2 , 10+suibian);
      e = v;
  cout<<"\n echo ";
	cout<<"1 "<< v<<" "<< e<<" ";
	for(i=0; i<v;i++)
	cout <<"v"<<to_string(i)<< " 1 ";

	for(i=0;i<e;i++)
	  {
	    a = rand()%v;
	    do{
	      b = rand()%v;
	    } 
	    while( a == b );

	    w = rand()%100;
	    cout<<"v"<<to_string( a )<<" "<<"v"<<to_string( b )<<" "<< to_string( w )<<" ";

	  }
	cout<<"v1";

	cout<< "| ./test2 | grep time";
	  }
 
return 0;
}
